package com.haoshuang.zhouzhoubang.ui.page.mine.integral.detail

import android.widget.TextView
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemStoreIntegralDetailBinding
import com.haoshuang.zhouzhoubang.model.bean.YuBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.textColor

/**
 *
 */
class StoreIntegralDetailAdapter(data: MutableList<YuBean.Data>) :
    BaseBindingQuickAdapter<YuBean.Data, ItemStoreIntegralDetailBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: YuBean.Data?) {
        holder.getViewBinding<ItemStoreIntegralDetailBinding>().apply {
            val tvTitle = holder.getView<TextView>(R.id.tvTitle)
            val tvTime = holder.getView<TextView>(R.id.tvTime)
            val tvValue = holder.getView<TextView>(R.id.tvValue)
            tvTitle.text=item?.title
            tvTime.text=item?.add_time
            if (item!!.pm > 0) {
                tvValue.textColor = R.color.c_00c24e
                tvValue.text = "${item?.number}"
            } else {
                tvValue.text = item?.number
            }
        }
    }
}
